package cn.stronglink.asset.module.dam.utils.factorys.req;

import java.util.Date;

import com.alibaba.fastjson.JSON;

import cn.stronglink.asset.module.dam.entity.message.MsgSensorTypeSetting;
import cn.stronglink.asset.module.dam.entity.message.secondMsg.AwsPostdataSensorTypeSetting;
import cn.stronglink.asset.module.dam.utils.dataJsonUtils.realtime.send.MsgSendUtil;
import cn.stronglink.asset.module.dam.utils.dataJsonUtils.req.send.SendCmdUtil;

public class Factory444SetSensorType {
	private static MsgSensorTypeSetting msgSensorTypeSetting=new MsgSensorTypeSetting();
	private static AwsPostdataSensorTypeSetting datas = new AwsPostdataSensorTypeSetting();
	//命令4=====设置传感器类型
		public static void setSensorType(int[] sensorTypes) {
			//创建数据对象： 用json转换， 发送数据
			msgSensorTypeSetting.setActioncode("screenCommand");
			msgSensorTypeSetting.setDevType("damDc");
			datas.setSensorTypes(sensorTypes);
			datas.setRackConverCode("000001");
			msgSensorTypeSetting.setAwsPostdata(datas);
			msgSensorTypeSetting.setTimestamp(new Date().getTime());
			//发送数据
			MsgSendUtil.sendMsg(SendCmdUtil.topic, JSON.toJSONString(msgSensorTypeSetting));// 发送消息
		}
}
